<template>
    <div id="details">
       <Head id="head"> 
           <div slot="head-left" @click="back" >
                <van-icon name="arrow-left" /> 
            </div>
            <div slot="head-center" class="left">
                详情
            </div>
            <div slot="head-right"  class="right">
                评论
            </div>
       </Head>
      <DeRota :img='img'></DeRota>
      <Introduce :pry = 'ins' :pry1 = 'ins1'
      :pry2 = 'ins2' :pry3 = 'ins3'
      
      ></Introduce>
      <Evaluation :eve = 'ins4'></Evaluation>
      <Comments 
      :uer = 'uer1' :content = 'uer1'
      ></Comments>
      <Adddd :img = 'img' @addAc='addAc'></Adddd>
    </div>
</template>
<script>
import Head from "../components/common/Head";
import DeRota from "../components/taobao/details/DeRota";
import Introduce from '../components/taobao/details/Introduce'
import Evaluation from '../components/taobao/details/Evaluation'
import Comments from '../components/taobao/details/Comments'
import Adddd from '../components/taobao/details/Adddd'
export default {
    name: "Details",
    components: {
        Head,
        DeRota,
        Introduce,
        Evaluation,
        Comments,
        Adddd
    },
    data() {
        return {
            det: null,
            img:null,
            ins:null,
            ins1:null,
            ins2 :null,
            ins3:null,
            ins4:null,
            uer1:null

        };
    },
    created() {
        this.det = this.$route.query.ma;
        this.img = this.$route.query.ma.path
       
        this.ins = this.$route.query.ma.originalPrice
        this.ins1 = this.$route.query.ma.presentPrice
        this.ins2 = this.$route.query.ma.introduce
          this.ins3 = this.$route.query.ma.activity
          this.ins4 = this.$route.query.ma.guarantee
           this.uer1 = this.$route.query.ma.name
      
        
    },
    methods:{
         back(){
            this.$router.back()
        },
        addAc(){
            let shop = {}
           shop.img =  this.det.img
           shop.ppp = this.det.originalPrice
           shop.shuo = this.det.introduce
           shop.count = 1

            this.$store.dispatch('addCart',shop)

        }


    }
};
</script>
<style scoped>
.input-text {
    position: relative;
    top: 9px;
    left: 10px;
}
#head{
    display: flex;

}
.left{
    position: relative;
    left: 50px;
}
.right{
     position: relative;
    left: -100px;
}
#details{
    padding: 5px;
}
</style>